package com.wages.project.system.dingding.service.impl;

import java.util.List;
import com.wages.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wages.project.system.dingding.mapper.DingdingMapper;
import com.wages.project.system.dingding.domain.Dingding;
import com.wages.project.system.dingding.service.IDingdingService;
import com.wages.common.utils.text.Convert;

/**
 * 考勤Service业务层处理
 *
 * @author wages
 * @date 2021-03-18
 */
@Service
public class DingdingServiceImpl implements IDingdingService
{
    @Autowired
    private DingdingMapper dingdingMapper;

    /**
     * 查询考勤
     *
     * @param id 考勤ID
     * @return 考勤
     */
    @Override
    public Dingding selectDingdingById(Long id)
    {
        return dingdingMapper.selectDingdingById(id);
    }

    /**
     * 查询考勤列表
     *
     * @param dingding 考勤
     * @return 考勤
     */
    @Override
    public List<Dingding> selectDingdingList(Dingding dingding)
    {
        return dingdingMapper.selectDingdingList(dingding);
    }

    /**
     * 新增考勤
     *
     * @param dingding 考勤
     * @return 结果
     */
    @Override
    public int insertDingding(Dingding dingding)
    {
        dingding.setCreateTime(DateUtils.getNowDate());
        return dingdingMapper.insertDingding(dingding);
    }

    /**
     * 修改考勤
     *
     * @param dingding 考勤
     * @return 结果
     */
    @Override
    public int updateDingding(Dingding dingding)
    {
        return dingdingMapper.updateDingding(dingding);
    }

    /**
     * 删除考勤对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteDingdingByIds(String ids)
    {
        return dingdingMapper.deleteDingdingByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除考勤信息
     *
     * @param id 考勤ID
     * @return 结果
     */
    @Override
    public int deleteDingdingById(Long id)
    {
        return dingdingMapper.deleteDingdingById(id);
    }
}
